package com.heima.model.common.dtos;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@Slf4j
@ApiModel("分页查询通用接收参数")

public class PageRequestDto {

    @ApiModelProperty("页码大小")
    protected Integer size;

    @ApiModelProperty("第几页")
    protected Integer page;

    public void checkParam() {
        if (this.page == null || this.page < 0) {
            setPage(1);
        }
        if (this.size == null || this.size < 10 || this.size > 100) {
            setSize(10);
        }
    }
}
